package org.osami.commons.dialog;

public interface IDialogService {
	
	public static final String EVENTTOPIC_MESSAGE = "org/osami/commons/dialog/Message";
	public static final String EVENTTOPIC_QUESTION = "org/osami/commons/dialog/Question";
	public static final String EVENTTOPIC_USERANSWER = "org/osami/commons/dialog/UserAnswer";
	
	public static final int MESSAGETYPE_INFO = 0;
	public static final int MESSAGETYPE_WARNING = 1;
	public static final int MESSAGETYPE_CRITICAL = 2;
	
	/**
	  * Creates a question to the user with answering options
	  *
	  * Questions will be displayed on a device capable of handling user interaction, e.g. mobile phone, tv, etc.
	  * Answers are handled with UserAnswer events containing the following information:
	  * - Topic: UserAnswer
	  * - Fields: questionid, answerid
	  * Field questionid is used to determine witch question was answered, answerid is an integer containing the
	  * index of the answer.
	  *
	  * @param text Question text displayed to the user
	  * @param options A list of available options for the user
	  * @return A unique question id that can be used later on to associate the created question with an answer
	  */
	
	public int createQuestion(String text, String [] options);
	
	/**
	  * Creates a message to the user
	  *
	  * Messages are used only to inform the user, no reply is expected. The following message types are possible:
	  * info, warning and critical.
	  *
	  * @param text Message text to be displayed
	  * @param type Type of the message, must be MESSAGETYPE_INFO, MESSAGETYPE_WARNING or MESSAGETYPE_CRITICAL
	  *
	  */
	 public void createMessage(String text, int type);
	 
}
